package com.rainier.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.rainier.bean.User;
import com.rainier.dao.UserDao;
import com.rainier.service.UserService;

@Component("userService")
public class UserServiceImpl implements UserService
{
	private UserDao userDao;
	
	@Resource(name="userDao")
	public void setUserDao(UserDao userDao)
	{
		this.userDao = userDao;
	}
	
	public boolean addUser(User user)
	{
		boolean b = true;
		try
		{
			userDao.addUser(user);
		} catch (Exception e)
		{
			e.printStackTrace();
			b = false;
		}
		return b;
	}

	public boolean checkUser(User user)
	{
		return userDao.checkUser(user);
	}

	public boolean checkUsername(String username)
	{
		return false;
	}

	public User getUserByName(String username)
	{
		return userDao.getUserByName(username);
	}

}
